package com.youhome.service.service;

import com.youhome.common.exception.CustomException;
import com.youhome.service.response.*;

import java.util.List;

/**
 * Created by chen365 on 2019/02/13.
 */
public interface ZillowService {

    TimeValueItemResult get_Zip_ZriPerSqft_AllHomes(String zip);

    Double getForecastRent(String zip, Double livingArea);

    /***
     * 房屋价格指数
     * @param type
     * @param zip
     * @return
     */
    ZhviResult get_Zip_Zhvi_Summary_AllHomes(Integer type, String zip);

    /***
     * 买方卖方指数
     * @param type
     * @param zip
     * @return
     */
    BuyerSellerResult get_Buyer_Seller_Index_Zip(Integer type, String zip);

    /***
     * 市场健康指数
     * @param type
     * @param zip
     * @return
     */
    MarketHealthResult get_Market_Health_Index_Zip(Integer type, String zip);

    /***
     * 时间序列
     * @param type
     * @param zip
     * @param year
     * @return
     * @throws CustomException
     */
    List<TimeValueItemResult> getTimeSeries(Integer type, String zip, Integer year) throws CustomException;

    /***
     * 房租
     * @param type
     * @param zip
     * @return
     */
    ZriResult get_Zip_Zri_AllHomes_Summary(Integer type, String zip);

    /**
     * 租售比
     * @param type
     * @param zip
     * @return
     */
    BreakEvenPRResult get_Break_Even_PR(Integer type, String zip);

    /**
     * 租金涨幅百分比预测
     * @param type
     * @param zip
     * @return
     */
    ZriForecastPublicResult get_Zri_Forecast_Public(Integer type, String zip)throws CustomException;

    /**
     * 贷款利息
     * @param type
     * @param year
     * @return
     */
    List<TimeValueItemResult> get_loan_interest(Integer type, Integer year);

    /***
     * 存量房数字及高中低价位房产分布比例 按大都会区统计
     * @param format
     * @param zip
     * @param year
     * @return
     * @throws CustomException
     */
    InventoryResult get_InventoryMeasure_Tiers_Metro_Public(String format, String zip,Integer year)throws CustomException;

    /**
     * 负资产率都会区统计
     * @param type
     * @param zip
     * @return
     * @throws CustomException
     */
    MetroNETiersResult get_Metro_NETiers(Integer type, String zip)throws CustomException;

    /***
     * 负资产率按城市统计
     * @param type
     * @param zip
     * @param t
     * @return
     */
    List<TimeValueItemResult> get_NegativeEquity_Public(Integer type, String zip, Integer t)throws CustomException;

    List<TimeSeriesItem> selectMOM(String zip, String time) throws CustomException;

    List<TimeSeriesItem> selectYOY(String zip, String time) throws CustomException;

    List<TimeValueItemResult> selectMedianRentByZip(String zipcode, String time) throws CustomException;

    List<TimeSeriesItem> selectRentalYieldByZip(String zipcode, String time) throws CustomException;

    List<TimeValueItemResult> get_InventoryMeasure_Tiers_Metro_Public_By_Tier_Format(Integer type, String tier, String format, String zip, Integer year) throws CustomException;

    /**
     * 存量房统计
     * @param type 类型 count,pct
     * @param zip 邮编
     * @return
     */
    InventoryResult inventory(String type,String zip);
}
